#include "../TypeTraits.h"
#include <UnitTest++/UnitTest++.h>

using namespace MockItNow;

namespace
{
	TEST (IsReferenceTypeTraitWorks)
	{
		CHECK_EQUAL(true, (bool)IsReference<bool&>::Value);
		CHECK_EQUAL(false, (bool)IsReference<bool>::Value);
		CHECK_EQUAL(false, (bool)IsReference<bool*>::Value);
	}

	TEST (IsPointerTypeTraitWorks)
	{
		CHECK_EQUAL(false, (bool)IsPointer<bool&>::Value);
		CHECK_EQUAL(false, (bool)IsPointer<bool>::Value);
		CHECK_EQUAL(true, (bool)IsPointer<bool*>::Value);
	}

	TEST (IsValueTypeTraitWorks)
	{
		CHECK_EQUAL(false, (bool)IsValue<bool&>::Value);
		CHECK_EQUAL(true, (bool)IsValue<bool>::Value);
		CHECK_EQUAL(false, (bool)IsValue<bool*>::Value);
	}

	TEST (IsConstTypeTraitWorks)
	{
		CHECK_EQUAL(false, (bool)IsConst<bool>::Value);
		CHECK_EQUAL(true, (bool)IsConst<const bool>::Value);
		CHECK_EQUAL(false, (bool)IsConst<bool&>::Value);
		CHECK_EQUAL(true, (bool)IsConst<const bool&>::Value);
		CHECK_EQUAL(false, (bool)IsConst<bool*>::Value);
		CHECK_EQUAL(true, (bool)IsConst<bool* const>::Value);
	}

	TEST (IsVoidTypeTraitWorks)
	{
		CHECK_EQUAL(true, (bool)IsVoid<void>::Value);
		CHECK_EQUAL(false, (bool)IsVoid<int>::Value);
		CHECK_EQUAL(false, (bool)IsVoid<void*>::Value);
	}
}
